extends ../../components/layout
append style
  +css('demo/demo.css')
block title
  title 日历
block content
  header.demos-header
    h1.demos-title 日历
  .gzl-cell__title 酒店日历
  .gzl-cell.hotel-calendar
    .gzl-cell__bd(data-target='start') 开始日期
    .gzl-cell__bd(data-target='end') 结束日期

  .gzl-cell__title 票券日历
  .gzl-cell.ticket-calendar.placeholder
    .gzl-cell__bd(data-target='cur') 请选择
  .gzl-cell.ticket-calendar2(data-date="2018-12-30")
    .gzl-cell__bd(data-target='cur') 2018-12-30

  .gzl-cell__title 跟团日历
  .travel-calendar

  .gzl-cell__title 日历
  .test-calendar
append script
  script.
    require(['calendar'], function () {
      $.calendar({
        type: 'travel',
        self: $(".travel-calendar"),
        nav: {
          '2018-11': parseInt(Math.random() * 10000),
          '2018-12': parseInt(Math.random() * 10000),
          '2019-01': parseInt(Math.random() * 10000),
          '2019-02': parseInt(Math.random() * 10000),
          '2019-03': parseInt(Math.random() * 10000)
        },
        date: {
          '2018-11-11': {holiday: '节日', tag: 'qiang', price: parseInt(Math.random() * 10000)},
          '2018-11-28': {holiday: '节日', tag: 'qiang', price: parseInt(Math.random() * 10000)},
          '2018-11-29': {holiday: '节日', tag: 'cu', price: parseInt(Math.random() * 10000)},
          '2018-12-01': {holiday: '节日', tag: 'jian', price: parseInt(Math.random() * 10000)},
          '2018-12-02': {holiday: '节日', tag: 'jian', price: parseInt(Math.random() * 10000), num: 0},
          '2018-12-03': {holiday: '节日', tag: 'jian', price: parseInt(Math.random() * 10000)},
          '2018-12-30': {holiday: '休', tag: 'cu', price: parseInt(Math.random() * 10000)},
          '2018-12-31': {holiday: '休', tag: 'cu', price: parseInt(Math.random() * 10000)},
          '2019-01-01': {holiday: '元旦', tag: 'qiang', price: parseInt(Math.random() * 10000)}
        },
        isFull: false,
        gridClick: function (date) {
          console.log(date)
        }
      })
      $.calendar({
        type: 'calendar',
        self: $(".test-calendar"),
        gridClick: function (date) {
          console.log(date)
        }
      })
      $(".hotel-calendar").calendar({
        range: true,
        date: {
          '2018-11-11': {holiday: '节日', tag: 'qiang'},
          '2018-11-28': {holiday: '节日', tag: 'qiang'},
          '2018-11-29': {holiday: '休', tag: 'cu'},
          '2018-12-01': {holiday: '节日', tag: 'jian'},
          '2018-12-02': {holiday: '节日', tag: 'jian'}
        },
        gridClick: function (date) {
          console.log(date)
        }
      });
      $(".ticket-calendar").calendar({
        isFull: false,
        date: {
          '2018-11-11': {holiday: '节日', tag: 'qiang', price: parseInt(Math.random()*10000)},
          '2018-11-28': {holiday: '节日', tag: 'qiang', price: parseInt(Math.random()*10000)},
          '2018-11-29': {holiday: '节日', tag: 'cu', price: parseInt(Math.random()*10000)},
          '2018-12-01': {holiday: '节日', tag: 'jian', price: parseInt(Math.random()*10000)},
          '2018-12-02': {holiday: '节日', tag: 'jian', price: parseInt(Math.random()*10000), num: 0},
          '2018-12-03': {holiday: '节日', tag: 'jian', price: parseInt(Math.random()*10000)},
          '2018-12-30': {holiday: '休', tag: 'cu', price: parseInt(Math.random()*10000)},
          '2018-12-31': {holiday: '休', tag: 'cu', price: parseInt(Math.random()*10000)},
          '2019-01-01': {holiday: '元旦', tag: 'qiang', price: parseInt(Math.random() * 10000)}
        },
        gridClick: function (date) {
          console.log(date)
        }
      });
      $(".ticket-calendar2").calendar({
        isFull: false,
        date: {
          '2018-11-11': {holiday: '节日', tag: 'qiang', price: parseInt(Math.random()*10000)},
          '2018-11-28': {holiday: '节日', tag: 'qiang', price: parseInt(Math.random()*10000)},
          '2018-11-29': {holiday: '节日', tag: 'cu', price: parseInt(Math.random()*10000)},
          '2018-12-01': {holiday: '节日', tag: 'jian', price: parseInt(Math.random()*10000)},
          '2018-12-02': {holiday: '节日', tag: 'jian', price: parseInt(Math.random()*10000), num: 0},
          '2018-12-03': {holiday: '节日', tag: 'jian', price: parseInt(Math.random()*10000)},
          '2018-12-30': {holiday: '休', tag: 'cu', price: parseInt(Math.random()*10000)},
          '2018-12-31': {holiday: '休', tag: 'cu', price: parseInt(Math.random()*10000)},
          '2019-01-01': {holiday: '元旦', tag: 'qiang', price: parseInt(Math.random() * 10000)}
        },
        gridClick: function (date) {
          console.log(date)
        }
      });
    })